﻿using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Media;

namespace FantomNext.Controls
{
    public class FantomShape : Control
    {
        public string Id;

        public ScaleTransform ScaleTransform = new ScaleTransform(1, 1);

        public RotateTransform RotationTransform = new RotateTransform();

        public TranslateTransform TranslateTransform = new TranslateTransform();

        public FantomShape(string id)
        {
            Id = id;
            UpdateTransform();
        }

        private void UpdateTransform()
        {
            var transformGroup = new TransformGroup();

            transformGroup.Children.Add(ScaleTransform);
            transformGroup.Children.Add(RotationTransform);
            transformGroup.Children.Add(TranslateTransform);
            RenderTransform = transformGroup;
        }

        public override void Render(DrawingContext context)
        {
            base.Render(context);
            context.DrawRectangle(Brushes.Aqua, new Pen(Brushes.Yellow, 1), new Rect(0, 0, Width, Height));
        }

    }
}
